cmake_minimum_required(VERSION 2.8)
project(zookeeperServer)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -lprotobuf -std=c++11")
find_package(Protobuf REQUIRED)
if(PROTOBUF_FOUND)
    message(STATUS "protobuf library found")
else()
    message(FATAL_ERROR "protobuf library is needed but cant be found")
endif()
set(SOURCE_FILES
        ../consensus/include/tk_config.h
        ../consensus/include/tk_elog.h
        ../consensus/include/tk_command.h
        ../consensus/include/tk_message.h
        ../serialization/include/tk_jute.h
        ../serialization/include/protobuff.pb.h
        ../serialization/src/protobuff.pb.cc
        ../serialization/src/tk_jute.cpp
        ../zookeeperServer/include/zk_adaptor.h
        ../zookeeperServer/src/zk_adaptor.cpp
        ../zookeeperServer/include/watch_manager.h
        ../zookeeperServer/src/watch_manager.cpp
        ../zookeeperServer/include/serverCnxn.h
        ../zookeeperServer/src/serverCnxn.cpp
        ../zookeeperServer/include/dataTree.h
        ../zookeeperServer/src/dataTree.cpp
        ../zookeeperServer/include/zookeeperServer.recordio.h
        ../zookeeperServer/src/zookeeperServer.recordio.c
        ../zookeeperServer/include/zookeeperServer.jute.h
        ../zookeeperServer/src/zookeeperServer.jute.c
        ../config/config.h
        include/tk_txn.h
        src/tk_txn.cpp
        test/test.cpp
        )

add_executable(logtest ${SOURCE_FILES})
